NSW abortion bill passes upper house