fix two 2.7 issues found by travis-ci

 * if cookiejar does not exists, IOError is raised
 * test the fp instance's type in diff_to_dict on str and unicode