Fix incorrect return value for empty string in safe_open.
Tiny optimization in safe_open.

We already know that next_component is neither null nor empty in the
second branch, because of 7f137f0ad5.