Fix SunOS error code for a non-empty directory

According to `rmdir(2)` on SmartOS, error code returned when trying to
remove a directory which isn't empty is `EEXIST`, while on other
operating systems it's `ENOTEMPTY`.