Liberals hang on to NSW heartland seats