Add test for issue 310
Catch exceptions when writing attributes (and cleanup)
Modify api_gen.py to propagate exceptions from _hdf5 without warnings
Merge pull request #315 from andrewcollette/issue_310

Issue 310 (Broken attribute writes with exception)