The pair had got too close to the shore and were in danger of getting stranded