Sun CC: Fix QFileDialog compilation

Only use the old getpwnam_r() function when _POSIX_C_SOURCE is
defined.

Task-number: QTBUG-21451
Change-Id: I6bfc4c9f784616fc08866542c34ed71ab69559e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>