I created a pull (not specific to this problem), which uses std::fstream instead of fopen() and such for reading/writing block/undo files.
Perhaps this can help in a way that it works a little different than current code, dunno. I also added somewhat clearer exception error messages.
https://github.com/bitcoin/bitcoin/pull/3277It's not intended for getting merged into the master branch yet, perhaps it never will, but you can give it a try.
Dia