Add apple_open() and import AppleDouble code from Netatalk