Fix for rstrip() on booleans, setstate method for dictwrapper

There was a bug with boolean keywords (like excludeme). Urllib tries to use rstrip() on boolean values. This commits converts them to str. Maybe there is a more pythonic way, but this works at least.