Is this change (was-> were) only applicable for the first person and not for the third?
No, it applies to all persons.
Is the book wrong?
It's not wrong. We do say '..if it wasn't so expensive'. But I think the book is misleading you if it suggests that this is the correct form, or the only correct form which we use. Strictly speaking, it should be 'if it weren't', but it is very common indeed for native speakers to use the 'was' form in is place.
Are both sentences correct?
Yes, in a way. Only the most pedantic of grammarians would say that 'if it wasn't' is incorrect. It's simply that 'weren't' is more correct.