darwin: DRY platform-specific error check
darwin: DRY platform-specific error check

PR-URL: https://github.com/libuv/libuv/pull/2097
Reviewed-By: Santiago Gimeno <3f17e29e343c4cf8809fb0970d81d6d8ee88d6b3@gmail.com>

unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso,unknownbrackets/maxcso