Crystal Palace narrowly beat the transfer deadline to complete the loan signing of Stephen Dobbie from Championship rivals Brighton.