Rework serc_safe to operate on file descriptors

Initial work by Matthias Kilian tweaks by me.
Merge pull request #1 from jturner/master

Rework serc_safe into serc_safe_open