pyldb: Add Python 3 compatibility (except strings)